package routes

import (
	controllers "supervideo/app/http/controllers/admin/v1"

	"github.com/gin-gonic/gin"
)

func RegisterAdminRoutes(r *gin.Engine) {
	// 测试一个 v1 的路由组，我们所有的 v1 版本的路由都将存放到这里
	v1 := r.Group("/admin/v1")
	{

		// 区间
		zc := new(controllers.ZoneController)
		v1.GET("/zone", zc.Index)
		v1.POST("/zone", zc.Store)
		v1.PUT("/zone/:id", zc.Update)
		v1.DELETE("/zone/:id", zc.Delete)
		v1.GET("/zone/:id", zc.Show)

		// 分类
		cac := new(controllers.CategoryController)
		v1.GET("/category", cac.Index)
		v1.POST("/category", cac.Store)
		v1.PUT("/category/:id", cac.Update)
		v1.DELETE("/category/:id", cac.Delete)
		v1.GET("/category/:id", cac.Show)

		// 视频
		vc := new(controllers.VideoController)
		v1.GET("/video", vc.Index)
		v1.POST("/video", vc.Store)
		v1.PUT("/video/:id", vc.Update)
		v1.DELETE("/video/:id", vc.Delete)
		v1.GET("/video/:id", vc.Show)

	}
}
